package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
    public static void main(String[] args) throws UnknownHostException {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ConfigurableApplicationContext applicationContext = SpringApplication.run(RuoYiApplication.class, args);
        // 获取上下文环境
        ConfigurableEnvironment environment = applicationContext.getEnvironment();
        String appName = environment.getProperty("ruoyi.name");
        String hostAddress = InetAddress.getLocalHost().getHostAddress();
        String port = environment.getProperty("server.port");

        System.out.println("(♥◠‿◠)ﾉﾞ  " + appName + "启动成功   ლ(´ڡ`ლ)ﾞ");
        System.out.println("Swagger文档: http://" + hostAddress + ":" + port + "/doc.html");
    }
}
